/**
 *  represent invoice class
 */

package source;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;

public class Invoice {

	List<DoctorsOrders> orders;
	Appointment appointment;
	Invoice invoice;
	public LinkedList<Billable> bills;
    //Billable bill;
	Patient patient;

	public Invoice(){
		bills = new LinkedList<Billable>();
	}
	public Invoice(Map<String, String> values){
   /*   if (this.bills.length>0)
        this.List<Billable> bills=bills;
     else{
        List<Billable> bills=new List<Billable>();
        bills.add(this.bill)
          }
          
		this.patient = patient;
		this.appointment = appointment;
		this.orders = orders;
//		for (int i=0; i < orders.length(); i++) {
//			bills.add(orders.getAt(i).billable);
//		}
*/
	}
	
	public List<Billable> addToBill(Billable bill){
		bills.add(bill);
		return bills;
	}  
	
	public String display(){
		String print="";
    	for (int i=0; i < bills.size(); i++){
	        print += bills.get(i).getTreatmentName() + " "+ bills.get(i).getPrice() + " "
	        		+ bills.get(i).getQuantity() + " " + bills.get(i).getTotal() + "/n";
      }
      
//		print="Patient:"+patient.getName()+"Date:"+appointment.getDate()+"Doctor:"+appointment.getDoctor()
//		for (int i=0; i<bills.length();i++)
//			print+="/n"+bills.getAt(i).itemizedBill();
//	}//ends display	
		return print;
			
	}
}
	 